﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DbSharp.Framework.Storage;
using DbSharp.Framework.Storage.XmlStorage;

namespace DbSharp.Framework.TestEngine
{
    class PerfCaseRunEnv
    {
        public bool WillExport { get; private set; }
        public IStorageFactory StorageFactory { get; private set; }

        private PerfCaseRunEnv()
        {
        }

        public static PerfCaseRunEnv GetRuntimeEnvironment(CaseRunType runType)
        {
            var env = new PerfCaseRunEnv();
            switch (runType)
            {
                case CaseRunType.ExportXml:
                    env.WillExport = true;
                    env.StorageFactory = new XmlStorageFactory();
                    break;
                case CaseRunType.Test:
                default:
                    env.WillExport = false;
                    env.StorageFactory = null;
                    break;
            }
            return env;
        }
    }


    class UnitCaseRunEnv
    {
        public IStorageFactory StorageFactory { get; private set; }

        private UnitCaseRunEnv()
        {
        }

        public static UnitCaseRunEnv GetRuntimeEnvironment()
        {
            var env = new UnitCaseRunEnv();
            env.StorageFactory = new XmlStorageFactory();

            return env;
        }
    }

}
